package com.gdit.revenue.service.Impl;

import com.gdit.revenue.dao.ChartDao;
import com.gdit.revenue.base.result.Results;
import com.gdit.revenue.base.result.ResponseCode;
import com.gdit.revenue.service.ChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;
//import java.util.List;

@Service
public class ChartServiceImpl implements ChartService {
    @Autowired
    ChartDao chartDao;


    @Override
    public Results countTemp(){
      List data=new ArrayList();
      data.add(chartDao.countTemp("买奶茶"));
      data.add(chartDao.countTemp("旅游"));
      data.add(chartDao.countTemp("电费"));
      data.add(chartDao.countTemp("充值游戏"));
      data.add(chartDao.countTemp("聚餐"));
      data.add(chartDao.countTemp("水费"));
      data.add(chartDao.countTemp("买衣服"));
      data.add(chartDao.countTemp("干饭"));
      //封装data数据，以及响应成功的信息，并且返回
        return Results.success(ResponseCode.SUCCESS,data);
  }

    @Override
    public Results countTemp1(){
        List data=new ArrayList();
        data.add(chartDao.countTemp1("买奶茶"));
        data.add(chartDao.countTemp1("旅游"));
        data.add(chartDao.countTemp1("电费"));
        data.add(chartDao.countTemp1("充值游戏"));
        data.add(chartDao.countTemp1("聚餐"));
        data.add(chartDao.countTemp1("水费"));
        data.add(chartDao.countTemp1("买衣服"));
        data.add(chartDao.countTemp1("干饭"));
        //封装data数据，以及响应成功的信息，并且返回
        return Results.success(ResponseCode.SUCCESS,data);
    }

}
